<!--  -->
<template>
  <div class=''>
    hello vue from vite! the msg is {{msg}}<br>
    <el-button size="large">elButton</el-button>
    <el-button type="primary">Primary</el-button>
    <div class="demo-pagination-block">
      <div class="demonstration">Total item count</div>
      <el-pagination
          v-model:current-page="currentPage1"
          :page-size="100"
          :small="small"
          :disabled="disabled"
          :background="background"
          layout="total, prev, pager, next"
          :total="1000"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
      />
    </div>
    <br>
    <el-button type="primary" @click='toLogin'>登陆</el-button>
  </div>
</template>

<script setup lang="ts">
  import { LoginResult,login } from '@/api/backend/auth'
  import { onMounted,ref ,Ref} from 'vue';

  defineProps<{
    title?: string
    likes?: number
    msg?: string
  }>()


  
  let loginResultRef:Ref<LoginResult> = ref<LoginResult>({code:0,msg:"haha"})


  async function toLogin(){
    login({username:"zz",password:"123"}).then((result:LoginResult)=>{
      loginResultRef.value=result
      alert(loginResultRef.value.data?.token)
    })
  }


  onMounted(()=>{

  })


</script>
<style scoped>
  .demo-pagination-block + .demo-pagination-block {
    margin-top: 10px;
  }
  .demo-pagination-block .demonstration {
    margin-bottom: 16px;
  }
</style>


